//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package test.test.键盘录入;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class 录入整数添加集合 {
    public 录入整数添加集合() {
    }

    public static void main(String[] args) {
        ArrayList<Integer> intList = new ArrayList();
        Scanner sc = new Scanner(System.in);

        while(getsum(intList) <= 200) {
            int num = Integer.parseInt(sc.nextLine());
            if (num >= 1 && num <= 100) {
                intList.add(num);
            } else {
                System.out.println("输入数据不合法重新输入(1~100)");
            }
        }

        System.out.println("集合所有数据和为：" + getsum(intList));
    }

    public static int getsum(List<Integer> intList) {
        int sum = 0;

        for(Integer integer : intList) {
            sum += integer;
        }

        return sum;
    }
}
